class SaleItem {
  final String productName;
  final int quantity;
  final double price;
  final String unit;

  SaleItem({
    required this.productName,
    required this.quantity,
    required this.price,
    required this.unit,
  });

  factory SaleItem.fromJson(Map<String, dynamic> json) {
    return SaleItem(
      productName: json['productName'] as String,
      quantity: json['quantity'] as int,
      price: (json['price'] as num).toDouble(),
      unit: json['unit'] as String,
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'productName': productName,
      'quantity': quantity,
      'price': price,
      'unit': unit,
    };
  }
} 